window.onload = function(){
    var container = document.getElementById("container");
    var canvas = document.createElement("canvas");
    container.appendChild(canvas)
    canvas.height = container.clientHeight;
    canvas.width = container.clientWidth;
    var gl = canvas.getContext("webgl");

    gl.clearColor(0.0,0.0,0.0,1.0);
    gl.clear(gl.COLOR_BUFFER_BIT);

    var red = document.getElementById("red");
    var green = document.getElementById("green");
    var blue = document.getElementById("blue");

    red.oninput = function(){
        gl.clearColor(red.value/255.0, green.value/255.0, blue.value/255.0, 1.0);
        gl.clear(gl.COLOR_BUFFER_BIT);
    };

    green.oninput = function(){
        gl.clearColor(red.value/255.0, green.value/255.0, blue.value/255.0, 1.0);
        gl.clear(gl.COLOR_BUFFER_BIT);
    };

    blue.oninput = function(){
        gl.clearColor(red.value/255.0, green.value/255.0, blue.value/255.0, 1.0);
        gl.clear(gl.COLOR_BUFFER_BIT);
    };
};